
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Quote a value.
This package makes it quite easy to quote one or more values.
Use this package if you need to quote one or more strings with straight or smart quotes.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
npm install quotation
In Deno with esm.sh
:
import {quotation} from 'https://esm.sh/quotation@2'
In browsers with esm.sh
:
<script type="module">
import {quotation} from 'https://esm.sh/quotation@2?bundle'
</script>
import {quotation} from 'quotation'
quotation('one') // => '"one"'
quotation(['one', 'two']) // => ['"one"', '"two"']
quotation('one', "'") // => "'one'"
quotation('one', '“', '”') // => '“one”'
This package exports the identifier quotation
.
There is no default export.
quotation(value[, open[, close]])
Quote a value.
value
(string
or string[]
)
— value to wrap in quotesopen
(string
, default: "
)
— character to add at start of value
close
(string
, default: open
or "
)
— character to add at end of value
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
This package is safe.
Yes please! See How to Contribute to Open Source.
FAQs
Quote a value
The npm package quotation receives a total of 71,913 weekly downloads. As such, quotation popularity was classified as popular.
We found that quotation demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.